gh-141510: Support frozendict in plistlib#145590
Conversation
vstinner
left a comment
There was a problem hiding this comment.
LGTM.
@serhiy-storchaka @ronaldoussoren: Do you want to double check this plistlib change?
| The property list (``.plist``) file format is a simple serialization supporting | ||
| basic object types, like dictionaries, lists, numbers and strings. Usually the | ||
| top level object is a dictionary. | ||
| top level object is a dictionary or frozen dictionary. |
There was a problem hiding this comment.
I'm not a native English speaker, but don't you have to repeat "a"?
| top level object is a dictionary or frozen dictionary. | |
| top level object is a dictionary or a frozen dictionary. |
| The property list (.plist) file format is a simple XML pickle supporting | ||
| basic object types, like dictionaries, lists, numbers and strings. | ||
| Usually the top level object is a dictionary. | ||
| Usually the top level object is a dictionary or frozen dictionary. |
There was a problem hiding this comment.
I'm not a native English speaker, but don't you have to repeat "a"?
| Usually the top level object is a dictionary or frozen dictionary. | |
| Usually the top level object is a dictionary or a frozen dictionary. |
| import plistlib | ||
|
|
||
| pl = dict( | ||
| pl = frozendict( |
There was a problem hiding this comment.
I'm not sure that using a frozendict is better than a dict for the only example generating a plist.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Please add a NEWS entry. Note that support of frozendict is half-hearted -- only for serialization. dict_type=frozendict does not work in load(). I am not sure that it is worth to add support for deserialization.
vstinner
left a comment
There was a problem hiding this comment.
Oh, can you also add plistlib to https://docs.python.org/dev/whatsnew/3.15.html#whatsnew315-frozendict?
I saw that and hesitated to propose a follow-up change to add |
This can add an overhead and this would not work in case of cyclic references in binary Plist. Originally, So, there is very little value in such feature, and it is very difficult to do without breaking corner cases. But this should be explicitly stated that frozendicts are supported only in one way (like tuple). |
📚 Documentation preview 📚: https://cpython-previews--145590.org.readthedocs.build/